from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.routing import APIRouter
from app.api.common.index import router as common_router
from app.api.image.index import router as image_router
from app.setting import settings

app = FastAPI()

api_router = APIRouter(prefix='/api')

api_router.include_router(common_router)
api_router.include_router(image_router)

app.mount("/static", StaticFiles(directory=settings.STATIC_DIR), name="static")
app.include_router(api_router)

@app.get('/')
def api_doc():
    return {
        "message": "Welcome to Xingzhi API",
        "data": [
            {
                "name": "zs",
                "age": 18
            },
            {
                "name": "ls",
                "age": 19
            },
            {
                "name": "ww",
                "age": 20
            }
        ]
    }
